#pragma once

#include <cuda_runtime.h>

namespace cufloat
{
    //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx atomic min max
    __device__ double atomicMin_double(double* address, double val);

    __device__ double atomicMax_double(double* address, double val);

    //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

    // 自定义 double 类型的原子最小值操作
    __device__ double AtomicMinDouble(double* address, double val);

    // 自定义 double 类型的原子最大值操作
    __device__ double AtomicMaxDouble(double* address, double val);

}  // namespace cudaf64

__global__ void CuReduceMinMax(int N, double* d_x, double* d_min, double* d_max);